<template>
  <div class="app">
    <div class="homeList">
        <div class="list">
            <div class="box" v-for="(item,index) in shop_list" :key="index" @click="toTetail(item)">
                <img :src="item.picUrl" alt="">
                <div class="text">
                    <h4>{{item.name}}</h4>
                    <div class="tet">
                         <p><span>☆4.3</span> <span>{{item.monthSalesTip}}</span></p>
                    </div>
                   
                    <div class="txt">
                        <p><span>{{item.minPriceTip}}</span><span>{{item.shippingFeeTip}}</span></p>
                        <p><span>{{item.deliveryTimeTip}}</span><span>{{item.distance}}</span></p>
                    </div>
                    
                </div>
            </div>
        </div>
       <Footer></Footer>
    </div>
  </div>
</template>

<script>
import {shop_list} from '../utils/api'
import Footer from './Footer.vue'
export default {
    data(){
        return{
            shop_list:[],
        }
    },
    components:{
        Footer,
    },
    mounted(){
        shop_list().then((res)=>{
            this.shop_list=res.data.list
        })        
    },
    methods:{
        toTetail(item){
            this.$router.push('/detail/'+item.mtWmPoiId)
        }
    }
      
    
}
</script>
<style lang="scss" scoped>

.box{
    display: flex;
    padding: 0 10px;
    margin-top: 10px;
    img{
        width: 90px;
        height: 90px;
        margin-right: 10px;
    }
    .text{
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        .txt{
        display: flex;
        justify-content:space-between;
        color: gray;
        font-size: 14px;
    }
        .tet p span:first-child{
            color: orangered;
        }
    }  
}

</style>